#include "stdafx.h"
#include "Logger.h"

#define LOGPATH "%ALLUSERSPROFILE%"

CLogger* CLogger::m_Instance = 0;

CLogger::CLogger(void)
{
	m_chLogpath = new char[100];
}

CLogger::~CLogger(void)
{
	if(!m_Instance)
		delete m_Instance;
	if(!m_chLogpath)
		delete m_chLogpath;
}

CLogger* CLogger::GetInstance()
{
	if(NULL == m_Instance)
	{
		m_Instance = new CLogger;
	}
	return m_Instance;
}

bool CLogger::LOG_INIT()
{
	bool bRet = true;
	ExpandEnvironmentStringsA( LOGPATH, m_chLogpath, 50 );
	if(FALSE != isLogExist())
	{

	}
	return bRet;
}

bool CLogger::isLogExist()
{
	WIN32_FIND_DATA fd;
	HANDLE hFind = NULL;
	hFind = FindFirstFile(L"elog", &fd);
	if(NULL != hFind)
		return TRUE;
	return FALSE;
}

bool CLogger::logit(const char* strLog)
{
	bool bRet = false;

	return true;
}

bool CLogger::LOG_UNINIT()
{

	return true;
}